package com.artist.service.Impl;

import com.artist.entity.TbWork;
import com.artist.mapper.WorkMapper;
import com.artist.service.WorkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service("workSerice")
public class WorkServiceImpl implements WorkService {
    @Autowired
    private WorkMapper mapper;
    @Override
    public List<TbWork> workAll() {

        return mapper.selectAll();
    }

    @Override
    public TbWork selectWorkByPrimaryKey(Long id) {
        return mapper.selectByPrimaryKey(id);
    }

    @Override
    public void saveWork(TbWork tbWork) {

        mapper.insertSelective(tbWork);
    }

    @Override
    public void updateWork(TbWork tbWork) {
        mapper.updateByPrimaryKeySelective(tbWork);

    }

    @Override
    public void deleteWordByPrimaryKey(Long id) {
        mapper.deleteByPrimaryKey(id);
    }
}
